<?php
//网站配置的修改
	include_once("./com.php");
	$rem="select * from system";
	$ser=mysql_query($rem);
	while($res=mysql_fetch_assoc($ser)){
		$tre[]=$res;
	};
	$id=$_GET['id'];
	if(isset($_GET['sub'])){
		$cvalue=$_GET['cvalue'];
		 $hid=$_GET['hid'];
		 $get="update system set cvalue='$cvalue' where id='$hid'";
		mysql_query($get);
		if(mysql_affected_rows()>0){
			echo"<script>
					alert('修改成功')
					location.href='conf_add.php'
					</script>";
		}else{
			echo"<script>
					alert('修改失败')
					location.href='conf_add1.php'
					</script>";
					echo "失败";
			
		}
	}





?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加网站配置</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="skin/css/base.css" />
<link rel="stylesheet" type="text/css" href="skin/css/main.css" />
</head>
<body leftmargin="8" topmargin='8'>
<table width="98%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px;margin-top:8px;">
  <tr>
    <td background="skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' colspan="2"><span><img src='skin/images/frame/arr3.gif' style='margin-right:10px;'>修改网站配置</span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>
		<table style="margin-bottom:8px;margin-top:8px;margin-left:20px;">
			<form action="" method="get" >
				
				<?php foreach ($tre as $key=>$value){ 
					if($id==$value['id']){ ?>
				<input type="hidden" name="hid" value="<?= $value['id'] ?>">		
			 <tr>
				<td>配置项目标题： &nbsp;&nbsp;<input type="text" name="ctitle" value="<?= $value['ctitle']?>" readonly></td>	
			 </tr>
			 <tr>
				 <td>配置项名称： &nbsp;&nbsp;<input type="text" name="cname" value="<?= $value['cname'] ?>" readonly></td>
			</tr>
			 <tr>
				 <td>配置项值： &nbsp;&nbsp;<input type="text" name="cvalue" value="<?= $value['cvalue'] ?>"></td>
			</tr>
				<?php }} ?>
			 <tr>
				 	<td colspan="2" align="center" height="40px">
				 	<input type="submit" name="sub" value=" 修改 " class="coolbt2"></td>
			 </tr>
			</form>
		</table>
	</td>
  </tr>
</table>
</body>
</html>
